package com.winspread.app.flow

import android.view.View
import androidx.lifecycle.Observer
import com.winspread.app.R
import com.winspread.app.databinding.ActivityFlowBinding
import com.winspread.mvvm.base.vm.BaseNotVmActivity
import com.winspread.mvvm.flowbus.SharedFlowBus


class FlowActivity : BaseNotVmActivity<ActivityFlowBinding>(R.layout.activity_flow) {

    var i = 0;
    override fun initView() {
        SharedFlowBus.onSticky(EventBean::class.java).observe(this, Observer {
            binding.tv.text  = it.value+"----"+it.key
        })


    }

    fun viewClick(view: View){
        i++
        SharedFlowBus.withSticky(EventBean::class.java).tryEmit(EventBean("SCREEN_RECORD",i.toString()))



    }


}